<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/2.css">
</head>
<body>
    <!-- 导航栏 -->
    <div class="box1">
        <div class="nav">
            <div class="nav1">
                <img src="img/2/1.1.png" alt="">
                <p>网络全案营销服务提供商</p>
            </div>
            <ul class="nav2">
                <li class="show">网站首页</li>
                <li>传说资源</li>
                <li>传悦案例</li>
                <li>传悦服务</li>
                <li>解决方案</li>
                <li>需求提交</li>
            </ul>
            <div class="nav3"><img src="img/1/1.2.png" alt=""></div>
        </div>
    </div>
    <!-- 内容 -->
    <div class="content">
        
    </div>
    <!-- 底部 -->
    <div class="footer">
        <div class="footer1">
            <img src="img/2/4.1.png" alt="">
            <div class="footer2">
                <ul>
                    <li>关于传说</li>
                    <li>新闻动态</li>
                    <li>传阅观点</li>
                    <li>联系传悦</li>
                    <li>加入传悦</li>
                    <li>付款账户</li>
                </ul>
                <p>Copyright 2013 创梦网络科技有限责任公司&nbsp;&nbsp;||&nbsp;&nbsp;传悦 Chnyoo.cn All Rights Reserved&nbsp;&nbsp;&nbsp;京ICP备12005221号</p>
            </div>
        </div>
    </div>
    <script src="jquery.min.js"></script>
    <script>
        //构造函数
        String.prototype.parseUrl = function(){
            let arr = this.slice(this.indexOf("?") + 1).split("&");
            let result = {}
            arr.forEach(item=>{
                let key = item.split("=")[0];
                let value = item.split("=")[1];
                
                result[key] = value;
            })
            return result;
        }

        $.ajax({
            url:"http://127.0.0.1:81/getnews",
            data:{
                id:location.href.parseUrl().id
            },
            success(data){
                $(".content").html(data.p2);
                $(".content .content2 img").attr("src",data.imgs)
                console.log(data)
            }
        })
    </script>
</body>
</html>